#include<iostream>
#include<algorithm>
#include<set>

using namespace std;

int main()
{
	int N;
	scanf("%d", &N);
	int arr[100] = { 0 };
	set<int>st;
	for (int i = 0; i < N; i++) {
		scanf("%d", &arr[i]);
		st.insert(arr[i]);
	}
	st.erase(0);
	int size = st.size();
	cout << size << endl;
	for (set<int>::iterator it = st.begin(); it != st.end(); it++) {
		cout << *it << ' ';
	}
	return 0;
}
